home *** CD-ROM | disk | FTP | other *** search
- property pTextName, pWhatChanges, pWhatShows, pDestination, pTemp, pGroupName, pInitialState, pNumStates, pComplexString, ancestor
- global gCurrentText, gDownloadTexts
-
- on beginSprite me
- pTemp = "temp"
- previousItemDelimiter = the itemDelimiter
- the itemDelimiter = "."
- pTextName = item 1 of the name of the member of sprite the spriteNum of me
- the itemDelimiter = previousItemDelimiter
- if pWhatShows = #gCurrentTextStatus then
- if pInitialState = #on then
- gCurrentText = pTextName
- sendAllSprites(#UpdateDetail, #text)
- end if
- else
- if pWhatShows = #selectedToDownLoadStatus then
- if pTextName = "gCurrent" then
- if getPos(gDownloadTexts, gCurrentText) then
- pInitialState = #on
- else
- pInitialState = #off
- end if
- else
- if getPos(gDownloadTexts, pTextName) then
- pInitialState = #on
- else
- pInitialState = #off
- end if
- end if
- end if
- end if
- if pNumStates = #complex then
- pNumStates = value(pComplexString)
- end if
- numTrans = pNumStates
- if pWhatShows = #nothing then
- togSty = 0
- else
- togSty = 1
- end if
- selfTog = pWhatChanges = pWhatShows
- togGrup = pGroupName
- togState = pInitialState
- if pWhatShows = #gCurrentTextStatus then
- togOffbl = 0
- else
- if pWhatShows = #selectedToDownLoadStatus then
- togOffbl = 1
- end if
- end if
- if pWhatChanges = #gCurrentTextStatus then
- togOnOthOff = 1
- else
- togOnOthOff = 0
- end if
- ancestor = new(script("Bitmap But 1"), me.spriteNum, numTrans, togSty, togGrup, togState, togOffbl, selfTog, togOnOthOff)
- UpdateWhatItShows(me)
- end
-
- on MouseUpAction me
- if pWhatChanges = #gCurrentTextStatus then
- gCurrentText = pTextName
- sendAllSprites(#UpdateDetail, #text)
- sendAllSprites(#UpdateWhatItShows)
- else
- if pWhatChanges = #selectedToDownLoadStatus then
- if pTextName = "gCurrent" then
- if not getPos(gDownloadTexts, gCurrentText) then
- append(gDownloadTexts, gCurrentText)
- else
- deleteAt(gDownloadTexts, getPos(gDownloadTexts, gCurrentText))
- end if
- else
- if not getPos(gDownloadTexts, pTextName) then
- append(gDownloadTexts, pTextName)
- else
- deleteAt(gDownloadTexts, getPos(gDownloadTexts, pTextName))
- end if
- end if
- end if
- end if
- if pDestination <> EMPTY then
- go(pDestination)
- end if
- end
-
- on MouseDownAction me
- nothing()
- end
-
- on MouseEnterAction me
- nothing()
- end
-
- on MouseLeaveAction me
- nothing()
- end
-
- on UpdateWhatItShows me
- if pWhatShows = #selectedToDownLoadStatus then
- if pTextName = "gCurrent" then
- if getPos(gDownloadTexts, gCurrentText) then
- state = #on
- else
- state = #off
- end if
- else
- if getPos(gDownloadTexts, pTextName) then
- state = #on
- else
- state = #off
- end if
- end if
- if not (state = me.pToggleState) then
- me.pToggleState = state
- setstate(me, me.pCurrentState)
- end if
- end if
- end
-
- on getPropertyDescriptionList me
- description = [:]
- addProp(description, #pInitialState, [#default: #off, #format: #symbol, #comment: "Initial State", #range: [#off, #on]])
- addProp(description, #pWhatChanges, [#default: #gCurrentTextStatus, #format: #symbol, #comment: "What It Changes", #range: [#nothing, #gCurrentTextStatus, #selectedToDownLoadStatus]])
- addProp(description, #pWhatShows, [#default: #gCurrentTextStatus, #format: #symbol, #comment: "What It Shows", #range: [#nothing, #gCurrentTextStatus, #selectedToDownLoadStatus]])
- addProp(description, #pGroupName, [#default: "TextButtons", #format: #string, #comment: "Toggle Group Name"])
- addProp(description, #pDestination, [#default: EMPTY, #format: #string, #comment: "Frame Destination"])
- addProp(description, #pNumStates, [#default: 3, #format: #symbol, #comment: "Number of States", #range: [2, 3, 4, 5, 6, #complex]])
- addProp(description, #pComplexString, [#default: "[[1,0],[1,0],[1,0],[#m,0],[#m,0],[#m,0]]", #format: #string, #comment: "Complex Array"])
- return description
- end
-
- on getBehaviorDescription me
- endChar = offset("--END OF HEADER", me.text)
- endLine = the number of lines in char 1 to endChar of the text of me - 1
- description = line 1 to endLine of the text of me
- repeat with whichLine = endLine down to 1
- if line whichLine of description = EMPTY then
- delete line whichLine of description
- end if
- end repeat
- delete line 1 of description
- return description
- end
-